package com.library.service.impl;

import com.library.dao.BookDao;
import com.library.entity.Book;
import com.library.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class BookServiceImpl implements BookService {

    @Autowired
    private BookDao bookDao;

    @Override
    public List<Book> getAllBooks() {
        return bookDao.findAllBooks();
    }

    @Override
    public void addBook(Book book) {
        bookDao.addBook(book); // 调用DAO层添加书籍
    }


}